package com.lcxw.hxzb.friendcircle.project.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lcxw.hxzb.friendcircle.project.system.domain.Income;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface IncomeMapper extends BaseMapper<Income> {

    @Select(
        "SELECT ROUND(SUM(rmb),2) FROM ywpd_income WHERE `addTime` > #{from} AND `addTime` <= #{to} and userId = #{userId} "
    )
    Double getTodayIncome(long userId, String from, String to);
}
